<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>用户管理</title>
    <style type="text/css">
        <!--
        body {
            margin-left: 0px;
            margin-top: 0px;
            margin-right: 0px;
            margin-bottom: 0px;
        }
        .tabfont01 {
            font-family: "宋体";
            font-size: 9px;
            color: #555555;
            text-decoration: none;
            text-align: center;
        }
        .font051 {font-family: "宋体";
            font-size: 12px;
            color: #333333;
            text-decoration: none;
            line-height: 20px;
        }
        .font201 {font-family: "宋体";
            font-size: 12px;
            color: #FF0000;
            text-decoration: none;
        }
        .button {
            font-family: "宋体";
            font-size: 14px;
            height: 37px;
        }
        html { overflow-x: auto; overflow-y: auto; border:0;}
        -->
    </style>

    <link href="${path}/backstage/css/css.css" rel="stylesheet" type="text/css" />
    <script type="text/JavaScript">

    </script>
    <link href="${path}/backstage/css/style.css" rel="stylesheet" type="text/css" />
</head>
<SCRIPT language=JavaScript>
    function sousuo(){
        window.open("gaojisousuo.htm","","depended=0,alwaysRaised=1,width=800,height=510,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0");
    }
    function selectAll(){
        var obj = document.fom.elements;
        for (var i=0;i<obj.length;i++){
            if (obj[i].name == "delid"){
                obj[i].checked = true;
            }
        }
    }

    function unselectAll(){
        var obj = document.fom.elements;
        for (var i=0;i<obj.length;i++){
            if (obj[i].name == "delid"){
                if (obj[i].checked==true) obj[i].checked = false;
                else obj[i].checked = true;
            }
        }
    }

    function link(){
        document.getElementById("fom").action="addrenwu.htm";
        document.getElementById("fom").submit();
    }

    //验证跳转页数是否合法
    function checkPage(){
        var value = document.getElementById("goPage").value;

        var reg=/^[0-9]+$/;

        var count = ${pageBean.pageCount};

        if(reg.test(value) && value!=0 && value<=count){
            //1.获取图书名称输入框的参数
            var username = document.getElementById("username").value;
            window.location="${path}/backstage/user/list?username="+username+"&pageNow="+value+"&pageSize="+${pageBean.pageSize}
        }else{
            alert("不匹配!");
        }
    }

</SCRIPT>

<body>
<form name="fom" id="fom" method="get" action="${path}/backstage/user/list">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">

        <tr>
            <td height="30">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td height="62" background="${path}/backstage/images/nav04.gif">

                        <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr>
                                <td width="21"><img src="${path}/backstage/images/ico07.gif" width="20" height="18" /></td>
                                <td width="538">查看内容：
                                    <input id="username" name="username" value="${username}" type="text" size="16"  placeholder="用户名查询"/>
                                    <span class="input-group-btn">
								<button class="btn btn-primary" type="submit">查询</button>
							  </span></td>
                                <td width="144" align="left"><a href="#" onclick="sousuo()">
                                    <input name="Submit3" type="button" class="right-button07" value="高级搜索" />
                                </a>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            </td>
        </tr>
        <tr>
            <td><table id="subtree1" <%--style="DISPLAY: "--%> width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                            <td height="20"><span class="newfont07">选择：<a href="#" class="right-font08" onclick="selectAll();">全选</a>-<a href="#" class="right-font08" onclick="unselectAll();">反选</a></span>
                                <%--<input name="Submit" type="button" class="right-button08" value="删除所选订单" />--%>
                        </tr>
                        <tr>
                            <td height="40" class="font42">
                                <table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#464646" class="newfont03">

                                    <thead>
                                    <tr class="CTitle" >
                                        <td height="22" colspan="12" align="center" style="font-size:16px">用户列表</td>
                                    </tr>
                                    <tr bgcolor="#EEEEEE">
                                        <th align="center" height="30">选择</th>
                                        <th>序号</th>
                                        <th>用户名</th>
                                        <th>姓名</th>
                                        <th>性别</th>
                                        <th>生日</th>
                                        <th>年龄</th>
                                        <th>电子邮件</th>
                                        <th>手机号</th>
                                        <th>用户等级</th>
                                        <th>绑定银行卡号</th>
                                        <th>解锁时间</th>
                                    </tr>
                                    </thead>
                                    <c:forEach items="${pageBean.list}" var="u"  varStatus="v">
                                    <tr bgcolor="#FFFFFF">
                                        <td height="20"><input type="checkbox" name="delid"/></td>
                                        <td>${v.index+1}</td>
                                        <td>${u.username}</td>
                                        <td>${u.name}</td>
                                        <td>${u.gender}</td>
                                        <td>${u.birthday}</td>
                                        <td>${u.age}</td>
                                        <td>${u.email}</td>
                                        <td>${u.tel}</td>
                                        <td>${u.rank}</td>
                                        <td>${u.cardNo}</td>
                                        <td>${u.unlockDate}</td>
                                    </tr>
                                    </c:forEach>
                                </table></td>
                        </tr>
                    </table>
                        <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr>
                                <td height="6"><img src="${path}/backstage/images/spacer.gif" width="1" height="1" /></td>
                            </tr>
                            <tr>
                                <td height="33">
                                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="right-font08">
                                        <!-- 将一些共性的url放入到一个变量中进行保存 -->
                                        <c:set value="username=${username}" var="url"></c:set>
                                        <tr>
                                        <td width="50%">共 <span class="right-text09">${pageBean.pageCount}</span> 页 | 第 <span class="right-text09">${pageBean.pageNow}</span> 页</td>
                                        <td width="49%" align="right">[<a href="${path}/backstage/user/list?pageNow=1" class="right-font08">首页</a> |
                                            <!-- 判断上一页的边界 -->
                                             <c:if test="${pageBean.pageNow>1}">
                                            <a href="${path}/backstage/user/list?pageNow=${pageBean.pageNow-1 }&${url}" class="right-font08">上一页</a>
                                             </c:if>
                                             <c:if test="${pageBean.pageNow==1}">
                                                 <a href="#" class="right-font08">上一页</a>
                                             </c:if>
                                            <!-- 判断下一页的边界值 -->
                                            <c:if test="${pageBean.pageNow<pageBean.pageCount}">
                                            | <a href="${path}/backstage/user/list?pageNow=${pageBean.pageNow+1 }&${url}" class="right-font08">下一页</a>
                                            </c:if>
                                            <c:if test="${pageBean.pageNow==pageBean.pageCount}">
                                                | <a href="#" class="right-font08">下一页</a>
                                            </c:if>
                                            | <a href="${path}/backstage/user/list?pageNow=${pageBean.pageCount}&${url}" class="right-font08">末页</a>] 转至：</td>
                                        <td width="1%"><table width="20" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td width="1%"><input  id="goPage" name="pageNow" type="text" class="right-textfield03" size="1" /></td>
                                                <td width="87%"><input name="Submit23222" type="button" class="right-button06" value=" " onclick="checkPage()" />
                                                </td>
                                            </tr>
                                        </table>
                                        </td>
                                    </tr>
                                </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            </td>
        </tr>
    </table>
</form>
</body>
</html>
